/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package czStvDpds;

import czStvDpds.graphics.Drawing2D;
import czStvDpds.graphics.GameWindow;
import czStvDpds.i18n.Internationalization;
import czStvDpds.mapmanagment.Map;
import czStvDpds.mapmanagment.MapLoader;
import czStvDpds.movement.CollisionManager;
import czStvDpds.movement.Player;
import java.io.IOException;

/**
 * Spustí hru ve 2D, pro potřeby debugování kolizí.
 *
 * @author Jirka
 */
public class Launcher2D extends LauncherBase {

    public static void main(String[] args) {
        new Launcher2D().run();
    }

    @Override
    public void initLibs() {
        String separator = System.getProperty("file.separator");
        System.setProperty("org.lwjgl.librarypath", System.getProperty("user.dir") + separator + "target" + separator + "natives");
    }

    @Override
    public void initResources() {
        logger.info("Hello World!");
        Internationalization.setLocale("cs", "CZ");
    }
    Drawing2D draw;

    @Override
    public void initGraphics() {
        draw = GameWindow.getDrawing();
        draw.setWindowState(GameWindow.GAME);

        // Přidat hráče
        draw.addPlayer(new Player(2, 2, 0));

        // Přidat fantom hráče pro test kolizí
        CollisionManager.getCollisionManager().addPlayer(new Player(6, 2, 0));
        System.out.println("Na souradnicih x: 6, y: 2 je neviditelny fantom hrac\nNa techto souradnicich by mela byt vyvolana kolize");
    }

    @Override
    public void initMaps() throws IOException {
        Map testMap = MapLoader.loadMap("resources/maps/testMap1337.txt");
        draw.setMapData(testMap);
        CollisionManager.getCollisionManager().setMap(testMap);
    }
}
